]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Only reset to the default level on unlocked latched levels
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 8 Sep 2023 17:01:29 +0000 (19:01 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 8 Sep 2023 19:42:38 +0000 (19:42 +0000)
Reportedly, non-alphanumeric key levels were able to stick by
happenstance, and let the user press multiple keys until explicitly
switching to a different mode. Reportedly, this broke, switching to
the default level after the first key press on the additional levels.

Since we have this information in the OSK key models (each level has
a "mode" field to either default/latched/locked), retrieve this
information for them for each level, and only reset to the default
level if on one of those latched levels, and the relevant key was not
locked through long-press.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5763
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2945>

js/ui/keyboard.js

index e029d0a7fec1eb0acae2c755945b8b9fd30bcbfb..3adf230fddc17f9e963ef9dbf22708f97f5b9bbe 100644 (file)
@@ -1498,6 +1498,7 @@ export const Keyboard = GObject.registerClass({
 
             let layout = new KeyContainer();
             layout.shiftKeys = [];
+            layout.mode = currentLevel.mode;
 
             this._loadRows(currentLevel, level, levels.length, layout);
             layers[level] = layout;
@@ -1534,7 +1535,7 @@ export const Keyboard = GObject.registerClass({
             if (key.action !== 'modifier') {
                 button.connect('commit', (_actor, keyval, str) => {
                     this._commitAction(keyval, str).then(() => {
-                        if (!this._latched)
+                        if (layout.mode === 'latched' && !this._latched)
                             this._setActiveLayer(0);
                     });
                 });